﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using GA.Shared.Interfaces;
using System.Windows;
using System.Runtime.Serialization;
using System.Windows.Data;

namespace GA.Shared.Objects
{
    public class Permission : LinkedDependencyObject
    {
        /// <summary>
        /// Identifies the Id Property.
        /// </summary>
        public static readonly DependencyProperty IdProperty =
            RegisterProperty(
                "Id",
                typeof(int),
                typeof(Permission),
                new PropertyMetadata(-1));

        /// <summary>
        /// Identifies the BooleanValue Property.
        /// </summary>
        public static readonly DependencyProperty BooleanValueProperty =
            RegisterProperty(
                "BooleanValue",
                typeof(bool?),
                typeof(Permission),
                new PropertyMetadata(null));

        /// <summary>
        /// Identifies the IntegerValue Property.
        /// </summary>
        public static readonly DependencyProperty IntegerValueProperty =
            RegisterProperty(
                "IntegerValue",
                typeof(int?),
                typeof(Permission),
                new PropertyMetadata(null));

        /// <summary>
        /// Identifies the DoubleValue Property.
        /// </summary>
        public static readonly DependencyProperty DoubleValueProperty =
            RegisterProperty(
                "DoubleValue",
                typeof(double?),
                typeof(Permission),
                new PropertyMetadata(null));

        /// <summary>
        /// Identifies the StringValue Property.
        /// </summary>
        public static readonly DependencyProperty StringValueProperty =
            RegisterProperty(
                "StringValue",
                typeof(string),
                typeof(Permission),
                new PropertyMetadata(null));

        /// <summary>
        /// Identifies the PermissionTypeId Property.
        /// </summary>
        public static readonly DependencyProperty PermissionTypeIdProperty =
            RegisterProperty(
                "PermissionTypeId",
                typeof(int),
                typeof(Permission),
                new PropertyMetadata(-1));

        /// <summary>
        /// Identifies the PermissionType Property.
        /// </summary>
        public static readonly DependencyProperty PermissionTypeProperty =
            RegisterProperty(
                "PermissionType",
                typeof(PermissionType),
                typeof(Permission),
                new PropertyMetadata(null));

        /// <summary>
        /// Identifies the UserId Property.
        /// </summary>
        public static readonly DependencyProperty UserIdProperty =
            RegisterProperty(
                "UserId",
                typeof(int),
                typeof(Permission),
                new PropertyMetadata(-1));

        /// <summary>
        /// Identifies the User Property.
        /// </summary>
        public static readonly DependencyProperty UserProperty =
            RegisterProperty(
                "User",
                typeof(User),
                typeof(Permission),
                new PropertyMetadata(null));

        /// <summary>
        /// Gets or sets the Id.
        /// </summary>
        
        public int Id
        {
            get { return (int)SafeGetValue(IdProperty); }
            set { SafeSetValue(IdProperty, value); }
        }

        /// <summary>
        /// Gets or sets the Boolean Value.
        /// </summary>
        
        public bool? BooleanValue
        {
            get { return (bool?)SafeGetValue(BooleanValueProperty); }
            set { SafeSetValue(BooleanValueProperty, value); }
        }

        /// <summary>
        /// Gets or sets the Integer Value.
        /// </summary>
        
        public int? IntegerValue
        {
            get { return (int?)SafeGetValue(IntegerValueProperty); }
            set { SafeSetValue(IntegerValueProperty, value); }
        }

        /// <summary>
        /// Gets or sets the Double Value.
        /// </summary>
        
        public double? DoubleValue
        {
            get { return (double?)SafeGetValue(DoubleValueProperty); }
            set { SafeSetValue(DoubleValueProperty, value); }
        }

        /// <summary>
        /// Gets or sets the String Value.
        /// </summary>
        
        public string StringValue
        {
            get { return (string)SafeGetValue(StringValueProperty); }
            set { SafeSetValue(StringValueProperty, value); }
        }

        /// <summary>
        /// Gets or sets the PermissionType Id.
        /// </summary>
        
        public int PermissionTypeId
        {
            get { return (int)SafeGetValue(PermissionTypeIdProperty); }
            set { SafeSetValue(PermissionTypeIdProperty, value); }
        }

        /// <summary>
        /// Gets or sets the PermissionType.
        /// </summary>
        
        public PermissionType PermissionType
        {
            get { return (PermissionType)SafeGetValue(PermissionTypeProperty); }
            set { SafeSetValue(PermissionTypeProperty, value); }
        }

        /// <summary>
        /// Gets or sets the User Id.
        /// </summary>
        
        public int UserId
        {
            get { return (int)SafeGetValue(UserIdProperty); }
            set { SafeSetValue(UserIdProperty, value); }
        }

        /// <summary>
        /// Gets or sets the User.
        /// </summary>
        
        public User User
        {
            get { return (User)SafeGetValue(UserProperty); }
            set { SafeSetValue(UserProperty, value); }
        }

        public Permission()
        {
        }

        public Permission(LinkedDependencyObject baseObject)
            : base(baseObject)
        {
        }

        public Permission(LinkedDependencyObject baseObject, BindingMode bindingMode)
            : base(baseObject, bindingMode)
        {
        }
    }
}
